﻿/// <reference path="../GeneratedArtifacts/viewModel.js" />

myapp.BrowseMovements.created = function (screen) {
    if (screen.MovementDate == null) {
        var today = new Date();
        today.setHours(0, 0, 0, 0); //show all my movements for today
        screen.MovementDate = today;
    }
};
myapp.BrowseMovements.FilterMovements_postRender = function (element, contentItem) {
    attachEnterClosePopup(element, contentItem);
    $FilterMovementDate = $("MovementDate", $(element));
};

/*
var $movementUpdatesDiv;
myapp.Home.movementUpdates_render = function (element, contentItem) {
    $movementUpdatesDiv = $('<div id="movementUpdatesDiv"/>').appendTo($(element));
    //movementUpdatesDiv = $('<div data-role="content" id="movementUpdatesDiv"><a href="#movementUpdatesPanel" data-role="button" data-inline="true" data-icon="bars">Show Panel</a></div><div data-role="panel" id="placeUpdatesPanel" data-theme="b"><div class="panel-content"><p>This panel has all the default options...</p><a href="#demo-links" data-rel="close" data-role="button" data-theme="c" data-icon="delete" data-inline="true">Close panel</a></div>').appendTo($(element)); //
    //$movementUpdatesDiv = $('<div data-role="content" id="movementUpdatesDiv"><a href="#movementUpdatesPanel" data-role="button" data-inline="true" data-icon="bars">Show Panel</a></div><div data-role="panel" id="movementUpdatesPanel" data-theme="b">panel content</div>').appendTo($(element));
};
*/

myapp.BrowseMovements.Refresh_execute = function (screen) {
    // Write code here.
    this.MovementFiltered.Refresh();
};